package cn.k7g.alloytest.mold.provide;

import cn.k7g.alloy.expose.DataProvider;
import cn.k7g.alloy.mold.var.AbsVar;
import cn.k7g.alloytest.mold.model.Student;
import cn.k7g.alloytest.mold.model.Teacher;
import cn.k7g.alloytest.mold.var.StudentVar;
import org.springframework.stereotype.Component;

@Component
public class StudentDataProvide implements DataProvider<Student> {
    @Override
    public boolean supports(AbsVar var) {
        return var instanceof StudentVar;
    }

    @Override
    public Student get(AbsVar var) {
        if (var.getFirstParam().equals(1L)) {
            return new Student(1L, "小明同学");
        }
        return null;
    }
}
